package com.whuan.stream.message;

import com.whuan.stream.config.MqConfig;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.stream.annotation.EnableBinding;
import org.springframework.cloud.stream.annotation.StreamListener;
import org.springframework.cloud.stream.messaging.Processor;
import org.springframework.messaging.handler.annotation.SendTo;
import org.springframework.stereotype.Component;

@Component
@Slf4j
@EnableBinding({Processor.class,MqConfig.class})
public class MyMQReciver {


/*    @StreamListener(Processor.INPUT)
    //@SendTo(MqConfig.SENDTOOUTPUT)
    public void process(String message){
        log.info("MyMQReciver111:{}",message);
    }*/
    @StreamListener(MqConfig.SENDTOINPUT)
    //@SendTo(MqConfig.SENDTOOUTPUT)
    public void process1(String message){
        log.info("MyMQReciver222:{}",message);
    }

    @StreamListener(Processor.INPUT)
    @SendTo(MqConfig.SENDTOINPUT)
    public String process(String message){
        log.info("MyMQReciver:{}",message);
        return "SendTo"+message;
    }

    @StreamListener(MqConfig.SENDTOINPUT)
    public void sendToProcess(String message){
        log.info("SendToMyMQReciver:{}",message);
    }

}
